
var pageload = {
    api:"?g=Admin&m=public&a=is_login"
};
pageload.init=function(){
    getUserInfo(pageload.api);
    tabSwitch();
}
function openClass() {
	var msg = {};
	msg.cmd = 'live';
	msg.from = userinfo.user.id;
	msg.status = 1;
	ws.send($.toJSON(msg));
	statusClass(msg.status)
}
/**
 * 下课
 * @return {[type]} [description]
 */
function closeClass() {
	var msg = {};
	msg.cmd = 'live';
	msg.from = userinfo.user.id;;
	msg.status = -1;
	ws.send($.toJSON(msg));
	statusClass(msg.status)
}
uploadImg()
$("#chat-uploadbt").on('change',function(){
	uploadImg()
})
function uploadImg(){

		$("#chat-uploadbt").fileupload({
	        url: '?s=api/upload/index',
	        dataType: 'json',
			success:function (data){
				sendMsg(data.result,"img","teacher")
			}
		})
}
document.onkeydown = function (e) {
	var ev = document.all ? window.event : e;
	if (ev.keyCode == 13) {
		checkSend('msg_content',"teacher",'message')
		return false;
	} else {
		return true;
	}
};

